# -*- coding: utf-8 -*-

logging_config = {
    "version": 1,
    "formatters": {
        "ins_wx": {
            "format": "[%(levelname).1s]%(asctime)s [%(name)s]: %(message)s"
        },
    },
    "handlers": {
        "root": {
            "level": "INFO",
            "filters": None,
            "class": "logging.handlers.TimedRotatingFileHandler",
            "filename": "log/ins_wx/site.log",
            "backupCount": 15,
            "when": "midnight",
            "formatter": 'ins_wx'
        },
    "ins_bp_debug": {
            "level": "DEBUG",
            "filters": None,
            "class": "logging.handlers.TimedRotatingFileHandler",
            "filename": "log/ins_wx/ins-debug.log",
            "backupCount": 15,
            "when": "midnight",
            "formatter": 'ins_wx'
        },
    "ins_bp_warning": {
            "level": "WARNING",
            "filters": None,
            "class": "logging.handlers.TimedRotatingFileHandler",
            "filename": "log/ins_wx/ins-warning.log",
            "backupCount": 15,
            "when": "midnight",
            "formatter": 'ins_wx'
        },
    },
    "loggers": {
        "": {
            "handlers": ["root"],
            "propagate": True,
        },
        "ins": {
            "handlers": ["ins_bp_debug", "ins_bp_warning"],
            "level": "DEBUG",
            "propagate": False,
        },
        "utils": {
            "handlers": ["ins_bp_debug", "ins_bp_warning"],
            "level": "DEBUG",
            "propagate": False,
        },
    }
}